package by.ins.life.impl;

import java.io.Serializable;

import by.ins.life.INuclear;
import by.yativem.commons.utils.math.IMath;


public class Nuclear implements Cloneable ,  Serializable, INuclear<Double>{
	
	private static final long serialVersionUID = 7693079346686633170L;
	
		
	protected Double w;
	protected Double state;
	protected Double threshold;

	@Override
	public Double getWeight() {
		return w;
	}
	
	@Override
	public void setWeight(Double w) {
		this.w = w;
	}

	public Nuclear() {
		w = new Double(0);
		state = new Double(0);
		threshold = new Double(0);
	}
	
	public Nuclear(Double weight, Double state){
		this.w = weight;
		this.state = state;
	}

	@Override
	public Object clone() {
		Nuclear clone = new Nuclear();
		clone.w = this.w.doubleValue();
		clone.state = this.state.doubleValue();
		clone.threshold = this.threshold;
		return clone;
	}
	
	@Deprecated
	public static INuclear<Double> getEmptyValue() {		
		return new Nuclear();
	}

	@Override
	public Nuclear getImmutable() {
		
	throw new UnsupportedOperationException();
	}

	@Override
	public void setState(Double state) {
		this.state = state;
		
	}

	@Override
	public Double getState() {
		
		return state;
	}

	@Override
	public void addsState(Double val) {
		this.state = state + val;
		
	}
	

	@Override
	public IMath<Double> getMath() {
		throw new UnsupportedOperationException("Method not implemented");
		//return null;
	}

	@Override
	public void setThreshold(Double threshold) {
		this.threshold = threshold;
		
	}

	@Override
	public Double getThreshold() {
		return threshold;

	}

}
